1. Field of the Invention
This invention relates generally to the load testing of web sites and other multi-user systems, and more particularly, the invention relates to software architectures for reducing a quantity of physical computing resources needed to generate a desired load.
2. Description of the Related Art
One aspect of server management relates to the ability of a server to handle peak loads. In the context of web sites, for example, the number of concurrent users a web site can support depends upon many factors. These factors may include: the complexity of the web site""s application architecture, the number and type of servers that host the web site, the configuration of the servers, and the bandwidth of the connection(s) to the web site.
Heavy use, approaching or beyond the practical capacity of a server system, can cause response times to degrade, sometimes to the point where the system becomes practically inaccessible. Up to a certain point, as the number of users of a server system increases, the system""s performance may remain at a relatively constant and acceptable level. Beyond this point, however, increased loads may cause drastic degradations in performance. Accordingly, system administrators often only become aware of an overload condition once the condition occurs.
Furthermore, the resolution of such a problem may require replacement of complete server systems, may require changes in communications systems, and/or may require the partial or total reworking of software that supports system. Depending upon whether additional equipment is available or needs to be ordered, adding servers may take from several hours to several days or even several weeks. Repairing software problems may take from several hours to several months.
In order to address these problems, software tools and services have been developed to load test web sites and other types of server systems. Examples of such tools and services include the LoadRunner(copyright) product of Mercury Interactive Corporation, and the associated hosted ActiveTest(trademark) service for load testing server systems over the Internet. These tools and services allow the performance of a server system to be measured under various load conditions, optionally before live deployment. In this manner, the practical capacities of web sites and other multi-user server systems can be identified in advance and compared to trends in actual use levels. Accordingly, future overloading of a server system can be anticipated, and solutions can be implemented, before a problem actually occurs.
One problem with existing load testing methods is that a significant quantity of computational resources is typically needed to generate an appropriate load. For example, to generate the load needed to appropriately stress a popular e-commerce site, it may be necessary use ten or twenty dedicated computers, each of which simulates the actions of several users. The present invention seeks to address this problem.
The present invention provides an improved software architecture for simulating the actions of users during server load testing. The invention involves the use of a virtual user control flow, which is preferably a thread, that handles multiple concurrent connections to the server system during the load testing process. The use of such virtual user threads significantly reduces the number of concurrent threads needed to produce a desired load. As a result, a given computer can generate a greater load (simulate a greater number of users) than is possible with conventional methods. The computing resources needed to load test a server system are therefore reduced.
The invention is preferably embodied within a load testing tool (computer program) that may be made available to web site operators as an installable software product, as a hosted load testing service, or both. The load testing tool preferably runs several virtual users on one or more clients to simulate user interactions with a web site. Each virtual user is executed as a virtual user thread under a process on a client computer. Each virtual user thread itself establishes and supports multiple connections to the web site. Additional threads therefore need not be created for each connection.
For each connection, the virtual user thread performs a sequence of functions to establish and support the connection. Functions that may potentially block are executed in an asynchronous mode. When executed in asynchronous mode, if a function cannot complete without blocking, it immediately returns a RESOURCE UNAVAILABLE error code. If a function returns a RESOURCE UNAVAILABLE code, the calling thread switches execution to another task. After the condition causing the RESOURCE UNAVAILABLE error code has been resolved, the thread can switch back to executing the interrupted task. In this manner, the single virtual user thread is able to support multiple simultaneous connections.
In an alternative embodiment, the virtual user flow of control may be embodied as a process rather than a thread. In this case, the main flow of control supports the multiple simultaneous connections.
The invention may be advantageously used to decrease the computing resources needed to load test web sites and other types of server systems.